var _class, _temp;

import Taro from '@tarojs/taro-rn';
import * as tslib_1 from "tslib";
import React from 'react';
import { Component } from "@tarojs/taro-rn";
import { View, Button, Text } from "@tarojs/components-rn";
import { observer, inject } from "@tarojs/mobx-rn";
import request from "../../utils/request";
import indexStyleSheet from "./index_styles";
var _styleSheet = indexStyleSheet;
let Index = (_temp = _class = class Index extends Component {
  constructor() {
    super(...arguments);
    /**
     * 指定config的类型声明为: Taro.Config
     *
     * 由于 typescript 对于 object 类型推导只能推出 Key 的基本类型
     * 对于像 navigationBarTextStyle: 'black' 这样的推导出的类型是 string
     * 提示和声明 navigationBarTextStyle: 'black' | 'white' 类型冲突, 需要显示声明类型
     */

    this.increment = () => {
      const { counterStore } = this.props;
      counterStore.increment();
    };

    this.decrement = () => {
      const { counterStore } = this.props;
      counterStore.decrement();
    };

    this.incrementAsync = () => {
      const { counterStore } = this.props;
      counterStore.incrementAsync();
    };

    this.link = () => {
      Taro.navigateTo({ url: '/pages/components/imgUpload' });
    };
  }
  componentWillMount() {
    this.requ();
  }
  requ() {
    console.log('222');
    let options = {
      body: '',
      method: 'GET'
    };
    request({ url: 'http://ynjcjx.com/api/services/app/mall/GetHome', options });
  }
  componentWillReact() {
    console.log('componentWillReact');
  }
  componentDidMount() {}
  componentWillUnmount() {}
  componentDidShow() {}
  componentDidHide() {}
  render() {
    const { counterStore: { counter } } = this.props;
    return <View style={_styleSheet["index"]}>
        <Button onClick={this.link}>图片上传</Button>
        <Button onClick={this.link}>图片上传</Button>
        <Button onClick={this.decrement}>-</Button>
        <Button onClick={this.incrementAsync}>Add Async</Button>
        <Text>{counter}</Text>
      </View>;
  }
}, _class.config = {
  navigationBarTitleText: '首页'
}, _temp);
Index = tslib_1.__decorate([inject('counterStore'), observer], Index);
export default Index;